/*
   Project AwesOmeScript
   Copyright 2010 Domenico Gentner

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License along
   with this program; if not, write to the Free Software Foundation, Inc.,
   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "stdafx.hpp"
#include "NewProjectDialog.hpp"

//////////////////////////////////////////////////////////////////////////
// NewProjectDialog
//////////////////////////////////////////////////////////////////////////
NewProjectDialog::NewProjectDialog(wxWindow* parent)
: wxDialog(parent, wxID_ANY, _("New Project")), m_txtChatlink(NULL), m_txtChatcommand(NULL)
{
	// Create parent GridSizer
	wxGridSizer* gSizer = new wxGridSizer(1, 1, 1, 1);

	// Create Sizer
	wxStaticBoxSizer* sbSizer = new wxStaticBoxSizer(wxVERTICAL, this, _("Please enter the Information below:"));

	// Label for Command
	wxStaticText* lblCommand = new wxStaticText(this, wxID_ANY, _("Command:"));
	lblCommand->SetToolTip(_("This will be the command you have to type into AO's chat to launch the script."));

	// Textbox for Command
	m_txtChatcommand = new EditTextBox(this, wxID_ANY, wxEmptyString);

	// Label for Chatlink
	wxStaticText* lblChatlink = new wxStaticText(this, wxID_ANY, _("Visible Chatlink:"));
	lblChatlink->SetToolTip(_("This will be the text others have to click on to see your script in a window."));

	// Textbox for Chatlink
	m_txtChatlink = new EditTextBox(this, wxID_ANY, wxEmptyString);

	// Add widgets to sizers
	sbSizer->SetMinSize(200,200);
	sbSizer->Add(lblCommand, 0, wxEXPAND|wxALL, 2);
	sbSizer->Add(m_txtChatcommand, 0, wxEXPAND|wxALL|wxFIXED_MINSIZE, 2);
	sbSizer->Add(lblChatlink, 0, wxEXPAND|wxALL, 2);
	sbSizer->Add(m_txtChatlink, 0, wxEXPAND|wxALL|wxFIXED_MINSIZE, 2);

	// Add a ok/cancel
	wxStdDialogButtonSizer* sdbSizer = new wxStdDialogButtonSizer();	
	wxButton* sdbSizerOK = new wxButton( this, wxID_OK );
	sdbSizer->AddButton( sdbSizerOK );
	wxButton* sdbSizerCancel = new wxButton( this, wxID_CANCEL );
	sdbSizer->AddButton( sdbSizerCancel );
	sdbSizer->Realize();

	// Add to sbSizer
	sbSizer->Add( sdbSizer, 1, wxEXPAND, 5 );

	// Add sbSizer to Gridsizer
	gSizer->Add( sbSizer, 1, wxALL|wxSHAPED, 5 );

	// Layout
	this->SetSizerAndFit(gSizer);

	// Centered is always nice
	this->CenterOnParent();
}
